package mn.idax.exchange.otc.enums.response;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.math.BigDecimal;

/**
 * @Auther: dison
 * @Date: 2018/8/8 10:34
 * @Description: 上传文件大小限制
 */
@Getter
@AllArgsConstructor
public enum UploadFileSizeEnum {

    PNG("png",100L,5L * 1024L * 1024L),
    JPG("jpg",100L,5L * 1024L * 1024L),
    JPEG("jpeg",100L,5L * 1024L * 1024L),
    GIF("gif",100L,5L * 1024L * 1024L),
    BMP("bmp",100L,5L * 1024L * 1024L),

    MP4("mp4",100L,50L * 1024L * 1024L),

    ZIP("zip",100L,50L * 1024L * 1024L),
    RAR("rar",100L,50L * 1024L * 1024L),
    ;

    private String ext;

    private Long minSize;

    private Long maxSize;

    public static UploadFileSizeEnum getValue(String ext){
        for (UploadFileSizeEnum value : UploadFileSizeEnum.values()) {
            if (value.getExt().equals(ext.trim().toLowerCase())){
                return value;
            }
        }
        return null;
    }
}
